package com.buka.mapper;

import com.buka.pojo.Cinema;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CinemaMapper {
    @Select("select * from t_cinema where cinema_name = #{username}")
    Cinema getCinemaByUsername(String username);

    @Insert("insert into t_cinema values(null,#{cinemaName},#{cinemaPassword},#{cinemaAddress},1)")
    int add(Cinema cinema);

    @Select("select * from t_cinema")
    List<Cinema> getCinemaList();

    @Update("update t_cinema set cinema_state = #{state} where cinema_id = #{cinemaId}")
    int changeForStateById(@Param("cinemaId") int cinemaId, @Param("state") int state);

}
